Writers of software on the C64 or emulators may wish to know whether the "machine" their code is executing on is a real C64, or not (e.g. for disabling fastloaders). Wolfgang Lorenz, the author or PC64, suggested a method that reveals the type of emulator based on a special use of the addresses $DFA0-$DFFF. See the following listing for details.
If you want to test this program on Power64, just copy the text from this document and paste it into an open Power64 emulator window. Power64 will respond with the following message:
Power64 (2.5.1)
Commodore 64 for Power Macintosh
(C) 1999 Roland Lieger
If the emulator detection awareness of Power64 should cause trouble with a program it can be disabled using the Options/ROM Patches dialog.
100 REM ********* WHERE AM I? *********
110 REM -------------------------------
120 REM THIS IS THE RECOMMENDED METHOD
130 REM HOW TO DETECT A C64 EMULATOR,
140 REM E.G. FOR DISABLING FAST LOADERS
150 REM
160 REM - THE BYTE AT $DFFF CHANGES
170 REM BETWEEN $55 AND $AA ON EVERY
180 REM READ ACCESS
190 REM - THE BYTE AT $DFFE CONTAINS
200 REM THE MANUFACTURER CODE LETTER:
210 REM A = C64ALIVE
220 REM F = FRODO
230 REM P = PERSONAL C64
240 REM S = C64 SOFTWARE EMULATOR
250 REM V = VICE
260 REM X = X64
270 REM / = POWER64
280 REM - THE WORD AT $DFFC CONTAINS
290 REM THE EMULATOR VERSION NUMBER,
300 REM E.G. $0120 FOR VERSION 1.2
310 REM - THE BYTES FROM $DFA0 CONTAIN
320 REM A COPYRIGHT STRING WITH
330 REM EMULATOR NAME AND VERSION,
340 REM $0D, COPYRIGHT AND $00.
350 REM -------------------------------
360 :
500 PRINT
510 X=57343: REM $DFFF
520 IF PEEK(X)<>85 THEN IF PEEK(X)<>85 THEN 1000
530 IF PEEK(X)<>170 THEN 1000
540 IF PEEK(X)<>85 THEN 1000
550 IF PEEK(X)<>170 THEN 1000
560 M$=CHR$(PEEK(57342)): REM $DFFE
570 PRINT "MANUFACTURER = '"; M$; "' ";
580 IF M$="A" THEN PRINT "(C64ALIVE)";
590 IF M$="F" THEN PRINT "(FRODO)";
600 IF M$="P" THEN PRINT "(PC64)";
610 IF M$="S" THEN PRINT "(C64S)";
620 IF M$="V" THEN PRINT "(VICE)";
630 IF M$="X" THEN PRINT "(X64)";
640 IF M$="/" THEN PRINT "(POWER64)";
650 PRINT
660 :
700 V=PEEK(57341)*256 + PEEK(57340): REM $DFFD/$DFFC